package com.firewolf.oa.base.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;

import com.firewolf.oa.base.BaseDao;
import com.firewolf.oa.base.BaseService;
@Transactional
public class BaseServiceImpl<T> implements BaseService<T> {

	@Autowired
	private BaseDao<T> baseDao;

	@Override
	public List<T> findAll() throws Exception {
		return baseDao.findAll();
	}

	@Override
	public T findById(Long id) throws Exception {
		return baseDao.findById(id);
	}

	@Override
	public void save(T t) throws Exception {
		baseDao.save(t);
	}

	@Override
	public void update(T t) throws Exception {
		baseDao.update(t);
	}

	@Override
	public void delete(Long id) throws Exception {
		baseDao.delete(id);
	}

	@Override
	public List<T> getByIds(Long[] ids) throws Exception {
		// TODO Auto-generated method stub
		return baseDao.getByIds(ids);
	}

}
